//
//  SKTHomeTableDetailViewController.m
//  SKTDemo
//
//  Created by Ashlike on 04/05/2018.
//  Copyright © 2018 cy55. All rights reserved.
//
#define cScreenHeight [UIScreen mainScreen].bounds.size.height
#define cScreenWidth [UIScreen mainScreen].bounds.size.width

#import "SKTHomeTableDetailViewController.h"
#import "SKTTableDetailCell.h"

@interface SKTHomeTableDetailViewController ()
<UITableViewDelegate,UITableViewDataSource>
@property (nonatomic, strong) UITableView *tableView;

@end

@implementation SKTHomeTableDetailViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.view.backgroundColor = [UIColor jc_colorWithHexString:@"e5eaee"];

    self.title = @"工程型材优化方案表";
    [self ks_setupLeftBackBarButtonItemWithColor:nil];
    [self creatTableView];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

- (void)creatTableView{
    
    _tableView = ({
        UITableView * tableView = [UITableView new];
        tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
        tableView.backgroundColor = [UIColor whiteColor];
        tableView.delegate = self;
        tableView.dataSource = self;
        [self.view addSubview:tableView];
        
        [tableView registerNib:[UINib nibWithNibName:@"SKTTableDetailCell" bundle:nil] forCellReuseIdentifier:@"SKTTableDetailCell"];
        tableView.translatesAutoresizingMaskIntoConstraints = NO;
        
        [tableView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.mas_equalTo(20);
            make.right.mas_equalTo(-20);
            make.top.mas_equalTo(20);
            make.height.mas_equalTo(cScreenHeight);
        }];
        
        tableView;
    });
}

#pragma tableView--delegate

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
    return 50;
}

-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
    return 1;
}

-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return 25;
}

-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    
    SKTTableDetailCell *cell = [tableView dequeueReusableCellWithIdentifier:@"SKTTableDetailCell" forIndexPath:indexPath];
    
    return cell;
}

-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    
}


@end
